package org.bbd.cumi.page;

import java.util.List;

import org.apache.tapestry.IExternalPage;
import org.apache.tapestry.IRequestCycle;
import org.bbd.cumi.bean.Access;

public abstract class LogViewDaily extends BaseCumiPage implements IExternalPage {

	private int year, month, date;
	
	public abstract Access getAccess();
	
	public void activateExternalPage(Object[] params, IRequestCycle cycle) {
	
		year=(Integer)params[0];
		month=(Integer)params[1];
		date=(Integer)params[2];
		
	}
	
	public List<Access>getAccessList()
	{
		return getAccessFacade().listAccessByDate(year, month, date, "size desc");
	}
	
	public String getSize()
	{
		return formatByte(getAccess().getSize());
	}
	
	public String getElapse()
	{
		return String.valueOf(getAccess().getElapsed());
	}

}
